package dk.dashboardFP.panels.displayPanel {
	import dk.dashboardFP.panels.ui.text.DFPLabel;
	import dk.dashboardFP.utils.describeObjectUtil.DescribeObjectUtil;
	import dk.dashboardFP.interactionElementFramwork.smartButton.SmartButton;

	import flash.display.DisplayObject;

	/**
	 * @author josef
	 */
	public class SelectionListButton extends SmartButton {

		private var _sLabel : String;
		private var _doLabel : DFPLabel;
		private var _doTargetObject : DisplayObject;
		private var _inspectChainButton : ListShortCutButton;

		public function SelectionListButton(doTargetObject : DisplayObject) {
			
			_doTargetObject = doTargetObject;
			_sLabel = DescribeObjectUtil.getObjectDescription(doTargetObject).className;
			
			setupElements();
		}

		private function setupElements() : void {
			
			//:::::::
			//  label 
			_doLabel = new DFPLabel(_sLabel, true);
			addChild(_doLabel);
		}

		override public function mouseOver() : void {
			super.mouseOver();
			dispatchEvent(new SelectionListItemEvent(SelectionListItemEvent.OVER_ITEM, true));
		}

		override public function mouseOutSelected() : void {
			mouseOut();
		}

		override public function mouseOut() : void {
			super.mouseOut();
			dispatchEvent(new SelectionListItemEvent(SelectionListItemEvent.OUT_ITEM, true));
		}

		public function get doTargetObject() : DisplayObject {
			return _doTargetObject;
		}

		override public function select() : void {
			super.select();
			alpha = 0.5;
		}

		override public function deSelect() : void {
			super.deSelect();
			alpha = 1;
		}
	}
}
